<div class="admin_header_blocks">
<?php if ((bool)$session->read('Auth.User')) { ?>
<div class="admin_header_block admin_header_block_profile"><span class="label"><?php echo __('you_are_logged_as', TRUE); ?></span><br /><span class="username"><?php echo $session->read('Auth.User.first_name'); ?>&nbsp;<?php echo $session->read('Auth.User.family_name'); ?></span><br /><span class="links"><?php echo $html->link(__('profile_action', TRUE), array('controller' => 'users', 'action' => 'profile')); ?> | <?php echo $html->link(__('logout_action', TRUE), array('controller' => 'users', 'action' => 'logout')); ?></span></div>
<?php } else { ?>
<div class="admin_header_block admin_header_block_login"><span class="label"><?php echo __('you_are_not_logged', TRUE); ?></span><br /><!-- &nbsp; --><br /><span class="links"><?php echo $html->link(__('login_action', TRUE), array('controller' => 'users', 'action' => 'login')); ?></span></div>
<?php } ?>
<div class="admin_header_block admin_header_block_info"><span class="label"><?php echo __('admin_section', TRUE); ?></span><br /><span class="domain"><?php echo $html->link(env('SERVER_NAME'), '/', array('target' => '_preview')); ?></span><br /><span class="engine"><?php echo Configure::read('Engine.name'); ?> <?php echo Configure::read('Engine.version'); ?></span></div>
</div>
<div class="admin_header_separator"><!-- &nbsp; --></div>
<?php if ((bool)$session->read('Auth.User')) { ?>
<div class="admin_header_line">
<?php

if (in_array($locale, (array)Configure::read('Config.languages'))) {
?>
<div class="admin_header_line_status"><?php echo $this->Html->image('/admin/img/flags/' . $locale . '.png', array('title' => $locale)); ?>&nbsp;<?php echo $subtitle_for_layout; ?> (<?php echo $locale; ?>)</div>
<?php } else { ?>
<div class="admin_header_line_status"><?php echo $subtitle_for_layout; ?></div>
<?php } ?>
<div class="admin_header_line_flags">
<?php

foreach ((array)Configure::read('Config.languages') as $_locale) {
?>
<div class="admin_header_line_flag"><?php echo $this->Html->link($this->Html->image('/admin/img/flags/' . $_locale . '.png'), array('lang' => $_locale, 'autoParams' => array('id')), array('title' => $_locale, 'escape' => FALSE)); ?></div>
<?php
}

?>
</div>
</div>
<?php } else { ?>
<div class="admin_header_status"><?php echo $subtitle_for_layout; ?></div>
<?php } ?>